export function isNumber(data: any): data is number {
  return typeof data === 'number'
}

export function isString(data: any): data is string {
  return typeof data === 'string'
}

export function isBoolean(data: any): data is boolean {
  return typeof data === 'boolean'
}

export function isNull(data: any): data is null {
  return data === null
}

export function isUndefined(data: any): data is undefined {
  return typeof data === 'undefined'
}

export function isObject(data: any): data is object {
  return typeof data === 'object'
}

export function isArray(data: any): data is any[] {
  return Array.isArray(data)
}

export function isDate(data: any): data is Date {
  return Object.prototype.toString.call(data) === '[object Date]'
}

export function isRegExp(data: any): data is RegExp {
  return Object.prototype.toString.call(data) === '[object RegExp]'
}

export function isSet(data: any): data is Set<any> {
  return Object.prototype.toString.call(data) === '[object Set]'
}

export function isMap(data: any): data is Map<any, any> {
  return Object.prototype.toString.call(data) === '[object Map]'
}
